﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NBusiness.Data.Commands
{
    public class ActionCommand : CommandBase
    {
        Action _action;

        public ActionCommand(Action action)
        {
            _action = action;
        }

        protected internal override void Run()
        {
            _action.BeginInvoke(delegate(IAsyncResult result)
            {
                _action.EndInvoke(result);
            }, null);

            OnCompleted();
        }
    }
}
